package com.vr.xxaiagent.agent;

import com.vr.xxaiagent.advisor.MyLoggerAdvisor;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.stereotype.Component;

/**
 * 初始化参数
 * @author hzh
 * @date 2025/06/08
 */
@Component
public class XxManus extends ToolCallAgent{
    public XxManus(ToolCallback[] availableTools, ChatModel dashscopeChatModel) {
        super(availableTools);
        this.setName("xxManus");
        this.setSystemPrompt(PromptConstant.SYSTEM_PROMPT);
        this.setNextStepPrompt(PromptConstant.NEXT_STEP_PROMPT);
        this.setMaxStep(20);
        // 初始化客户端
        ChatClient chatClient = ChatClient.builder(dashscopeChatModel)
                .defaultAdvisors(new MyLoggerAdvisor())
                .build();
        this.setLlm(chatClient);
    }
}
